package com.gzc.pm.enum
{
	import mx.collections.ArrayCollection;

	public class StandardEnum
	{
		public function StandardEnum(value:uint=0, name:String="")
		{
			this.value = value;
			this.name = name;
		}
		
		public var value:uint;
		public var name:String;
		
		public static const CONTROL:StandardEnum = new StandardEnum(0, '控制图');
		public static const TOLERANCE:StandardEnum = new StandardEnum(1, '公差图');
		
		[Bindable] public static var standardList:ArrayCollection = new ArrayCollection([
			CONTROL, TOLERANCE
		]);
		
		public static function getNameByValue(v:uint):String{
			var n:String = '';
			
			switch(v){
				case CONTROL.value:
					n = CONTROL.name;
					break;
				case TOLERANCE.value:
					n = TOLERANCE.name;
					break;
			}
			
			return n;
		}
		
	}
}